package com.anjie.powerproject.strategy.pojo;

/**
 * 结点 / 路径包装类
 */
public class PathAndNode {
    private String path;
    private String node;
    private String[] pathSplit;
    private String[] nodeSplit;

    public PathAndNode(String node, String path) {
        this.path = path;
        this.node = node;
        this.pathSplit = path.split(",");
        this.nodeSplit = node.split(",");
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
        this.pathSplit = path.split(",");
    }

    public String getNode() {
        return node;
    }

    public void setNode(String node) {
        this.node = node;
        this.nodeSplit = node.split(",");
    }

    public String[] getPathSplit() {
        return pathSplit;
    }

    public void setPathSplit(String[] pathSplit) {
        this.pathSplit = pathSplit;
        this.path = String.join(",", pathSplit);
    }

    public void setBoth(String[] nodeSplit, String[] pathSplit) {
        setNodeSplit(nodeSplit);
        setPathSplit(pathSplit);
    }

    public String[] getNodeSplit() {
        return nodeSplit;
    }

    public void setNodeSplit(String[] nodeSplit) {
        this.nodeSplit = nodeSplit;
        this.node = String.join(",", nodeSplit);
    }
}